<?php

require_once dirname(__FILE__).'/../lib/apartmanGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/apartmanGeneratorHelper.class.php';

/**
 * apartman actions.
 *
 * @package    estate
 * @subpackage apartman
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class apartmanActions extends autoApartmanActions
{
  
  public function executeEdit(sfWebRequest $request)
  {
    $this->apartman = $this->getRoute()->getObject();
    $this->form = $this->configuration->getForm($this->apartman);
  }
  
  public function executeTimeTable(sfWebRequest $request){
  	$id = $this->getRequestParameter("id");
  	if($id){
  		$c = new Criteria();
  		$c->add(ApartmanBookingPeer::APARTMAN_ID,$id);
  		$this->bookings = ApartmanBookingPeer::doSelect($c);
  		$c = new Criteria();
  		$c->add(ApartmanPeer::ID,$id);
  		$this->apartement = ApartmanPeer::doSelectOne($c);
  	}
  }
  
}